﻿using Eqwww.Domain.Models.Identity;
using Eqwww.Domain.Models.SystemManage;
using System;
using System.ComponentModel.DataAnnotations;

namespace Eqwww.Web.Areas.SystemManage.Models.User
{
    public class CreateViewModel
    {
        [Display(Name ="用户名")]
        [Required(ErrorMessage ="本项不能为空")]
        [RegularExpression(@"[0-9a-zA-Z_@.\-]{4,100}", ErrorMessage ="用户名只能包含数字、大小写字母、下划线、@和.")]
        public string UserName { get; set; }

        [Display(Name ="电子邮箱")]
        [Required(ErrorMessage = "本项不能为空")]
        [EmailAddress(ErrorMessage ="电子邮箱格式不正确")]
        public string Email { get; set; }

        [Required(ErrorMessage ="本项不能为空")]
        [Display(Name = "账号类型")]
        public UserType? UserType { get; set; }


        [Display(Name = "密码")]
        public string Password { get; set; }

        [Display(Name = "确认密码")]
        public string RepeatPassword { get; set; }

        [Display(Name = "姓名")]
        [Required(ErrorMessage = "本项不能为空")]
        public string RealName { get; set; }

        [Display(Name = "联系方式")]
        [Required(ErrorMessage = "本项不能为空")]
        public string Contact { get; set; }

        [Display(Name = "系统头像")]
        [Required(ErrorMessage = "本项不能为空")]
        public string Avatar { get; set; }

        [Display(Name = "排序码")]
        [Required(ErrorMessage = "本项不能为空")]
        public int? SortCode { get; set; }

        
    }
}
